def shuchu(n):
    if n==1 or n==2 or n==3:
        return 1
    else:
        a,b,c=1,1,1
        for i in range(n-1):
            a,b,c=b,c,a+b+c
        return a
print("前20项的和为",shuchu(20))
